package cn.hesion.Speak;
/**
 * ClassName: SpeekBean <br/>
 * Description: <br/>
 * date: 2021/2/2 14:55<br/>
 *
 * @author Hesion<br />
 * @version
 * @since JDK 1.8
 */

import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

/**
 * @program: ClientDemo
 * @description: 语音日志类
 * @author: hesion
 * @create: 2021-02-02 14:55
 **/
public class SpeakBean implements Writable {
    private long selfDuration;
    private long thirdPartDuration;
    private long sumDuration;

    @Override
    public void write(DataOutput out) throws IOException {
        out.writeLong(this.selfDuration);
        out.writeLong(this.thirdPartDuration);
        out.writeLong(this.sumDuration);
    }

    @Override
    public void readFields(DataInput in) throws IOException {
        this.selfDuration = in.readLong();
        this.thirdPartDuration = in.readLong();
        this.thirdPartDuration = in.readLong();
    }
    public void set(long selfDuration,long thirdPartDuration){
        this.selfDuration= selfDuration;
        this.thirdPartDuration = thirdPartDuration;
        this.sumDuration= this.selfDuration+this.thirdPartDuration;
    }
    public SpeakBean(long selfDuration, long thirdPartDuration) {
        this.selfDuration = selfDuration;
        this.thirdPartDuration = thirdPartDuration;
        this.sumDuration = selfDuration + thirdPartDuration;
    }

    public SpeakBean() {
    }

    public long getSelfDuration() {
        return selfDuration;
    }

    public void setSelfDuration(long selfDuration) {
        this.selfDuration = selfDuration;
    }

    public long getThirdPartDuration() {
        return thirdPartDuration;
    }

    public void setThirdPartDuration(long thirdPartDuration) {
        this.thirdPartDuration = thirdPartDuration;
    }

    public long getSumDuration() {
        return sumDuration;
    }

    public void setSumDuration(long sumDuration) {
        this.sumDuration = sumDuration;
    }

    @Override
    public String toString() {
        return selfDuration +
                "\t" + thirdPartDuration +
                "\t" + sumDuration;
    }


}
